home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Night Owl 6
/
Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso
/
039a
/
rmtc01.zip
/
READDEF.C
< prev
next >
Wrap
Text File
|
1991-11-02
|
1KB
|
52 lines
/* ************************************************ */
/* WriteDef.c */
/* Purpose : Reads a DEF file */
/* Compiler: Turbo C V2.0 */
/* Date : Oct 31, 1991 */
/* ************************************************ */
#include <graphics.h>
#include <stdio.h>
main()
{
FILE *F;
int driver, mode, size;
int x, y, i, j, xoffset, yoffset;
int col, ch;
driver=EGA;
mode=EGAHI;
initgraph(&driver,&mode,""); /* Set path to your EGAVGA.BGI */
x=300;
y=120;
xoffset=0;
yoffset=0;
F=fopen("Rm.def","r"); /* Rm.def must be in current */
do /* directory. */
{
ch=fgetc(F);
if (ch=='\n')
{
xoffset=0;
yoffset++;
}
else
{
if (ch>47 && ch < 58)
{
col=ch-48;
putpixel(x+xoffset,y+yoffset,col);
}
else if (ch>64 && ch<71)
{
col=ch-55;
putpixel(x+xoffset,y+yoffset,col);
}
xoffset++;
}
} while (ch!=eof(F));
fclose(F);
getch();
closegraph();
}